<template>
  <div>
    <!-- 搜索 -->
    <!-- <div class="iptBox padL32 flexLeft">
      <input type="text" class="flex1 fontS20" placeholder="请输入关键词" />
      <div class="inquire wColor fontS20">查询</div>
    </div> -->
    <!-- 公告标题 -->
    <div class="maxWidth">
      <div class="declare_box">
        <div class="fontS18 fonBold">公告标题</div>
        <div class="fontS18 fonBold">公告时间</div>
      </div>
      <div class="declare_main_boxs">
        <div
          class="declare_item_boxs fontS18"
          v-for="(i, k) in noticeList"
          :key="k"
          @click="getNoticeDetail(i.noticeId)"
        >
          <div class="declare_item_title fonts18">
            {{ i.noticeTitle }}
          </div>
          <div class="fonts18">{{ i.createTime }}</div>
        </div>
        <div class="pagination">
          <a-pagination v-model="current" :total="total" show-less-items />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getNoticeList } from "@/api";
export default {
  data() {
    return {
      noticeList: [],
      current: 1,
      total: 0,
    };
  },
  async created() {
    const res = await getNoticeList();
    this.noticeList = res.rows;
    this.total = res.total;
  },
  methods: {
    getNoticeDetail(id) {
      console.log(id);
      this.$router.push({ name: "NoticeDetails", params: { id } });
    },
  },
};
</script>

<style lang="scss" scoped>
.declare_box {
  padding: 17px 22px;
  background: #eeeff9;
  border-radius: 12px 12px 0 0;
  margin-top: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}
.declare_main_boxs {
  background-color: #fff;
  padding: 0 24px;
  box-sizing: border-box;
  border-radius: 0 0 12px 12px;
  .declare_item_boxs {
    border-bottom: 1px solid #b8babd;
    cursor: pointer;
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .declare_item_title {
      margin-left: 20px;
      position: relative;
      &::after {
        content: "";
        position: absolute;
        left: -15px;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 4px;
        background: #1a60ff;
      }
    }
  }
}
.pagination {
  padding-bottom: 53px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 30px;
}
</style>